<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>用工招聘</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/vant.css">
    <link rel="stylesheet" href="../../css/main.css">
    <style>
        html,body,.app{
            background: #fff;
        }
        .van-field__body textarea {
            width: 3.51rem;
            height: 1.36rem !important;
            border-radius: .05rem;
            padding: 0 .08rem;
        }

        .flex-wrap {
            flex-wrap: wrap;
        }

        .f3>div {
            margin-bottom: .1rem;
        }
    </style>
</head>

<body>
    <div class="app" v-cloak>

        <div class="bgf iphonex-padding-bottom recruit">
            <div class="recruit-detail">
                <div class="f1 flex-x-sb">
                    <span class="title">{{objEmploy.workTypeName}}</span>
                    <div class="money" v-if="objEmploy.salary">
                        <span>¥</span>{{objEmploy.salary}} {{objEmploy.salaryUnitName}}
                    </div>
                    <div class="money" v-else>
                        <span>面议</span>
                    </div>
                </div>
                <div class="f2 flex-x-s flex-label">
                    <div class="label" v-for="tag in objEmploy.tags" :key="tag.id" @click="goTagDetail(tag)">{{tag.name}}</div>
                </div>
                <div class="f3 flex-x-sb flex-wrap">
                    <div class="flex-x-s flex-wrap">
                        <div class="flex-x-sb">
                            <span class="iconfont">&#xe611;</span>
                            <span>{{objEmploy.addressName}}</span>
                        </div>
                        <div class="flex-x-sb">
                            <span class="iconfont">&#xe601;</span>
                            <span>{{objEmploy.experienceName}}</span>
                        </div>
                        <div v-if="type == 0">{{objEmploy.workNatureName}}</div>
                    </div>
                    <div>{{objEmploy.publishTime | handleTimePlus('//')}}</div>
                </div>
            </div>
            <div class="recruit-info">
                <div>
                    <span>发布源</span>
                    <span>{{objEmploy.publisherType==0?'平台':objEmploy.publisherType==1?'个人 ':'商家'}}</span>
                </div>
                <div>
                    <span>发布人</span>
                    <span>{{objEmploy.shopName}}</span>
                </div>
                <!-- <div v-if="type == 0">
                    <span>招聘人数</span>
                    <span>{{objEmploy.number}} 人</span>
                </div>
                <div v-else>
                    <span>到岗时间</span>
                    <span>{{objEmploy.arrivalTime | handleTimePlus('//')}}</span>
                </div> -->
            </div>
            <div class="recruit-introduce">
                <div v-if="type == 0">岗位要求</div>
                <div v-else>自我介绍</div>
                <pre>{{objEmploy.intro}}</pre>
            </div>
        </div>
    </div>
    <script src="../../script/api.js"></script>
    <script src="../../script/flexible.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/vue.min.js"></script>
    <script src="../../script/iconfont.js"></script>
    <script src="../../script/common.js"></script>
    <script src="../../script/restful.js"></script>
    <script src="../../script/businessCommon.js"></script>
    <script src="../../script/vant.min.js"></script>
    <script>
        apiready = function () {
            vm = new Vue({
                el: '.app',
                data: {
                    active: 0,
                    objEmploy: {

                    },
                    type: 0,
                    module: '',
                    id: api.pageParam.id
                },
                mounted() {
                    var vm = this;
                    this.type = api.pageParam.type
                    this.initEmployDetail();
                },
                filters: {
                    handleTimePlus
                },
                methods: {
                    goTagDetail(item){
                        api.openWin({
                            name: 'tag_win',
                            url: '../common/tag_win.html',
                            bounces: false,
                            pageParam: {item : item}
                        });
                    },
                    initEmployDetail() {
                        var vm = vm || this;
                        index.employ("getEmployDetail")(api.pageParam.id, function (ret) {
                            vm.objEmploy = ret.data
                        })
                    },
                    backPage() {
                        api.closeWin();
                    },
                    call() {
                        var phone = this.objEmploy.phone.split(',')
                        api.actionSheet({
                            cancelTitle: '取消',
                            buttons: phone
                        }, function (ret, err) {
                            if (ret.buttonIndex > phone.length) return false;
                            api.call({
                                type: 'call_type',
                                number: phone[ret.buttonIndex - 1]
                            });
                        });
                    },
                },
            })
            api.addEventListener({
                name: 'sendRecruit'
            }, function (ret, err) {
                var type = ret.value.type
                if (type == 'call') {
                    if (!checkToken()) return false;
                    vm.call()
                }
            });
        }
    </script>
</body>

</html>
